import request from '@/utils/request'

// 查询请假列表
export function listLeavemanage(query) {
  return request({
    url: '/leave/leavemanage/list',
    method: 'get',
    params: query
  })
}
// 查询请假列表
export function listLeavemanage1(query) {
  return request({
    url: '/leave/leavemanage/list1',
    method: 'get',
    params: query
  })
}

// 查询请假详细
export function getLeavemanage(id) {
  return request({
    url: '/leave/leavemanage/' + id,
    method: 'get'
  })
}

// 新增请假
export function addLeavemanage(data) {
  return request({
    url: '/leave/leavemanage',
    method: 'post',
    data: data
  })
}

// 修改请假
export function updateLeavemanage(data) {
  return request({
    url: '/leave/leavemanage',
    method: 'put',
    data: data
  })
}

// 删除请假
export function delLeavemanage(id) {
  return request({
    url: '/leave/leavemanage/' + id,
    method: 'delete'
  })
}
/**
 * 根据老人ID查询其所有请假记录
 */
export function getElderlyLeaveRecords(elderlyId) {
  return request({
    url: '/leave/leavemanage/elderly/'+elderlyId, // 后端接口地址，与Controller中定义的一致
    method: 'get' // 请求方式：GET
  })
}

